<template>
  <div>
    <tab-bar>
      <tab-bar-item v-for="item in list" :key="item.name" :path="item.path">
        <template v-slot:img_normal>
          <img :src="item.imgNormal" alt />
        </template>
        <template v-slot:img_active>
          <img :src="item.imageActive" alt />
        </template>
        <template v-slot:item_text>
          <div>{{item.name}}</div>
        </template>
      </tab-bar-item>
    </tab-bar>
  </div>
</template>
<script>
import TabBar from "@/components/common/tabbar/TabBar";
import TabBarItem from "@/components/common/tabbar/TabBarItem";
export default {
  name: "MainTabBar",
  components: {
    TabBar,
    TabBarItem
  },
  data() {
    return {
      list: [
        {
          name: "首页",
          path: "/home",
          imgNormal: require("@/assets/img/tabbar/home_icon.svg"),
          imageActive: require("@/assets/img/tabbar/home_active_icon.svg")
        },
        {
          name: "分类",
          path: "/category",
          imgNormal: require("@/assets/img/tabbar/category_icon.svg"),
          imageActive: require("@/assets/img/tabbar/category_active_icon.svg")
        },
        {
          name: "购物车",
          path: "/shopcar",
          imgNormal: require("@/assets/img/tabbar/shop_car_icon.svg"),
          imageActive: require("@/assets/img/tabbar/shop_car_active_icon.svg")
        },
        {
          name: "我的",
          path: "/profile",
          imgNormal: require("@/assets/img/tabbar/profile_icon.svg"),
          imageActive: require("@/assets/img/tabbar/profile_active_icon.svg")
        }
      ]
    };
  }
};
</script>
<style scoped>
img {
  width: 24px;
  height: 24px;
  margin-top: 3px;
}
</style>